<?php
	echo $accessibility->whereIAm($pageTitle,array(array('title'=>'Álbuns','link'=>'/webs/albuns'),array('title'=>'Visualizar álbum')));
	echo $this->renderElement('message');
	echo "<h2 id='contentTitle'>".$pageTitle."</h2>";
	echo "<div id='view'>";



	// Getting file extension
	echo "<p><label>Título: </label> <span>".$album['Album']['titulo']."</span></p>";
	echo "<p><label>Data: </label> <span>".date_format(date_create($album['Album']['data']),'d/m/Y')."</span></p>";
	echo "<p><label>Descrição: </label> <span>".$album['Album']['descricao']. " </span></p>";


	echo '<p>';
	$listButton = "<span class=\"buttonAdd\">Adicionar fotos</span>";
	echo html_entity_decode($html->link($listButton, '/images/upload/'.$album['Album']['id'],array('class'=>'button')));
	echo '</p>';
	

	echo "	

<style>
		#image_gallery {
background-color:#ECF3E1;
position:relative;
text-align:center;
width:85%;
}
ul#gallery_thumbs {
display:inline-block;
margin-left:410px;
list-style: none;
margin: 0;
padding: 0;
}
#gallery_thumbs li {
background: none;
display: inline-block;
margin-left:0px;
}
.thumb img { /* styles thumbnail previews */
background: #fff;
padding: 2px;
border: 1px solid #ddd;
}
.thumb:hover img {
background-color: transparent;
}
.thumb span { /* hides large previews */
visibility: hidden;
position: absolute;
}
.thumb span img { /* styles large previews */
background: #fff;
padding: 2px;
border: 1px solid #ddd;
position: absolute;
left: 0;
top: 0px; 
}
.thumb:hover span { /* displays preview while hovering over thumb */
visibility: visible;
position: absolute;
left: 0;
top: 0px; /* absolute positioning to control where previews are displayed */
z-index: 100;
}

</style>
";




echo '<div style="margin-left:50px;">';
echo $box->iniciaBlocoFotos("Fotos",600,"background-color:#ECF3E1; float:none; padding-top:30px");
if(count($album['Image']) > 0)
{

	echo '<center>';
	echo '<ul id="gallery_thumbs">';
	foreach($album['Image'] as $image)
		{
		$filename = $image['filename'];
		echo '	
			
			<li>
			<div style="display:inline-block;width:100px; margin:15px;">		
				<a class="thumb" href="../../images/show/'.$image['id'].'" >
					
					
					<div style="text-align:center;"> '.$html->image($filename,array('class'=>'image','style'=>'max-width:100px;max-height:100px')).' </div>
					<div style="position:relative; text-align:center;">'.
						$image['legenda'].' '.
						html_entity_decode($html->link($html->image('filedel.png',array('class'=>'icon','style'=>'vertical-align:sub;width:12px;')), '/images/delete/'.$image['id'], array(), 'Confirma a exclusão deste item?')).
					'</div>

				</a>
				</div>
			</li>';
		}
	echo	'</ul>';
	echo '</center>';
	
}
else
{
	echo '<p style="margin-left:50px;"> Nenhuma imagem foi adicionada ao álbum </p>';
}
echo $box->finalizaBloco();
echo '</div>';

	echo '<p>';
	$listButton = "<span class=\"buttonAdd\">Adicionar fotos</span>";
	echo html_entity_decode($html->link($listButton, '/images/upload/'.$album['Album']['id'],array('class'=>'button')));
	echo '</p>';

	

	echo '<p>';
	$listButton = "<span class=\"buttonList\">Listar álbuns</span>";
	echo html_entity_decode($html->link($listButton, '/webs/albuns',array('class'=>'button')));
	echo '</p>';

